from django.core.urlresolvers import reverse
from django.template import Library

register = Library()

@register.simple_tag
def full_mock_url(resource, request):
    """Build a full URL for the mock `resource` based on the `request`."""
    return request.build_absolute_uri(reverse('mock', args=(resource.label,)))
